{include file="public/head"/}
<script language="javascript">
	$(document).ready(function () {
		// datatimepicker 设置
		$('.form_datetime').datetimepicker({
			language: 'zh-CN', // en ,zh-CN, pt-BR
			minView: 'month',
			weekStart: 0, //一周从哪一天开始
			todayBtn:  1, //
			autoclose: 1,
			todayHighlight: 1,
			startView: 2,
			forceParse: 1,
			showMeridian: 1
		});

	});
</script>

<div class="container-fluid" id="main">
    <div class="row clearfix">
        <div class="col-md-12 column mainmsg">
            <div class="alert alert-dismissable alert-info">
                <button type="button" class="close">×</button>
                 <p></p>
            </div>
        </div>
    </div>
    <input type="hidden"id="country_id" v-model="data.country_id">
    <input type="hidden" ref="plan_ids" value="{$plan_ids|default=''}">
    <input type="hidden" id="po_id" value="{$po_id|default=''}">
    <input type="hidden" id="company_id" v-model="data.company_id">
   
    <div class="ntDesktop">
    	<div class="ntDesktop-head" type="{$request|default=''}">{$title|default=''}</div>
    
        <div class="row clearfix" style="padding-top:0px">
            <div class="col-md-12 text-right">
                <div>
                    <!-- <a href="javascript:history.go(-1)" class="btn btn-default"><span class="glyphicon glyphicon-chevron-left"></span>{:strtoupper(lang('back_to_list'))}</a> -->
                    <a class="btn btn-default" @click="backToList()"><span class="glyphicon glyphicon-chevron-left"></span>{:strtoupper(lang('back_to_list'))}</a>
                    <a href="javascript:;" class="btn btn-primary" style="padding-left:2em;padding-right:2em;" @click="savefun"> <span class="glyphicon glyphicon-floppy-disk"></span> {:strtoupper(lang('save'))}</a>
                </div>
            </div>
        </div>
    
        <div class="row" style="padding:1em">
            <div class="col-md-8">
                <table class="table table-striped table-hover ntTable" v-cloak>
                        <colgroup>
                            <col width="150">
                            <col>
                        </colgroup>
                    <tbody>
                        <tr>
                            <td style="vertical-align:middle">{:strtoupper(lang("delivery_time"))}<span class="required"></span></td>
                            <td>
                                <div class="input-group date form_datetime" data-date="2019-12-12" data-date-format="yyyy-mm-dd" data-link-field="workdate">
                                    <input class="form-control" type="text" ref="jhdate" v-model="data.delivery_day" >
                                    <span class="input-group-addon"><span class="glyphicon glyphicon-calendar" style="margin:0"></span></span>
                                </div>
                                <input type="hidden" id="workdate" :value="data.delivery_day" />
                            </td>
                        </tr>
                        <tr>
                            <td>{:strtoupper(lang("delivery_address"))}<span class="required"></span></td>
                            <td>
                                <select class="form-control" v-model="data.port_id">
                                    <option value="0">{:strtoupper(lang("select_delivery_address"))}</option>
                                    <option :value="item.id" v-for="(item,index) in port">{{item.name}}</option>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td>{:strtoupper(lang("designated_company"))}<span class="required"></span></td>
                            <td>
                            	<div class="row">
	                                <div class="col-md-12">
                                        <div class="input-group">
                                            <input type="text" class="form-control col-md-12" placeholder="{:strtoupper(lang("enter_the_company_name"))}" width="100%" v-model="search">
                                            <div class="input-group-btn">
                                                <button type="button" class="btn btn-default" @click="getcompany">
                                                    <span class="glyphicon glyphicon-search"></span> {:strtoupper(lang('search'))}
                                                </button>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td>&nbsp;</td>
                            <td>
								<div class="row">
	                                <div class="col-md-12">
                                        <div class="input-group">
                                            <select class="form-control" @change="changecompany" v-model="data.company_id">
                                                <template v-if="company.length > 0">
                                                    <option value="0">{:strtoupper(lang("please_select_company"))}</option>
                                                    <option :value="item.id" v-for="(item,index) in company">{{item.name}}</option>    
                                                </template>
                                                <template v-else><option value="0">{:strtoupper(lang("no_data"))}</option></template>
                                            </select>
                                            <div class="input-group-btn">
                                                <button type="button" class="btn btn-primary" @click="getcominfo">
                                                    <span class="fa fa-file-alt"></span> {:strtoupper(lang("data"))}
                                                </button>
                                            </div>
                                        </div>
                                    </div>
                                </div>

                            </td>
                        </tr>
                        <tr>
                            <td>{:strtoupper(lang('contact'))}<span class="required"></span></td>
                            <td>
								<div class="row">
	                                <div class="col-md-12">
                                        <div class="input-group">
                                            <select class="form-control" v-model="data.linkman_id">
                                                <option value="0">请选择联系人</option>
                                                <option :value="item.id" v-for="(item,index) in linkman">{{item.name + '/' + item.content}}</option>
                                            </select>
                                            <div class="input-group-btn">
                                                <a href="javascript:;" v-show="data.linkman_id==0" class="btn btn-primary" disabled>编辑</a>
                                                <a v-show="data.linkman_id!=0" :href="'/admin/customer/liaisonedit?liaison?liaisonedit&linkid='+data.linkman_id" type="button" class="btn btn-primary" data-toggle="modal" data-target="#linkman_Modal" >
                                                    <span class="glyphicon glyphicon-pencil"></span> {:strtoupper(lang('edit'))}
                                                </a>
                                                <a v-show="data.company_id==0"  class="btn btn-primary" href="jacascript:;" title="请先选择公司" disabled>添加</a>
                                                <a v-show="data.company_id!=0" href="/admin/customer/liaisonadd" type="button" class="btn btn-primary" data-toggle="modal" data-target="#linkman_Modal">
                                                    <span class="glyphicon glyphicon-plus"></span> {:strtoupper(lang('add'))}
                                                </a>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </td>
                        </tr>
                    </tbody>
                </table>

                <div class="row">
                    <div class="col-md-6">
                        <ul class="nav nav-tabs">
                            <li class="active" id="tab_po_detail">
                                <a href="#po_detail_list" data-toggle="tab">{:strtoupper(lang("purchase_list"))}</a>
                            </li>
                            {if condition="$request eq 'edit'"}
                            <li>
                                <a href="#po_pack_list" data-toggle="tab">{:strtoupper(lang("packing_list"))}</a>
                            </li>
                            {/if}
                        </ul>
                    </div>
                    <div class="col-md-6 text-right">
                        <div>
                            {if condition="$request eq 'edit'"}
                            <button type="button" class="btn btn-sm btn-primary" data-toggle="modal" data-target="#pack_editModal" id="btn_add_pack" @click="boxing_content_added()">
                                <span class="fa fa-box-open"></span> {:strtoupper(lang("boxing_content_added"))}
                            </button>
                            {/if}

                            <button type="button" class="btn btn-sm btn-primary" data-toggle="modal" data-target="#plan_addModal" v-show="data.sign_day==0">
                                <span class="glyphicon glyphicon-plus"></span> {:strtoupper(lang("purchase_plan_added"))}
                            </button>
                        </div>
                    </div>
                </div>

                <div class="row tab-content" v-cloak>
                    <!-- 采购清单 -->
                    <div class="col-md-12 tab-pane active" id="po_detail_list">
                        <table class="table table-striped table-hover ntTable">
                            <thead>
                                <tr>
                                    <th>{:strtoupper(lang("planned_order_number"))}</th>
                                    <th>&nbsp;</th>
                                    <th>{:strtoupper(lang('product'))}</th>
                                    <th>{:strtoupper(lang("box_measure"))}</th>
                                    <th>{:strtoupper(lang("quantity"))}</th>
                                    <th>{:strtoupper(lang('price'))}/{:strtoupper(lang('amount'))}</th>
                                    <th>{:strtoupper(lang("buyer"))}</th>
                                    <th>{:strtoupper(lang('operate'))}</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr v-for="(item,index) in plan">
                                    <td>{{formatUnit(item.id,'ID')}}</td>
                                    <td><img :src="item.img_url" width="48px" height="48px" border="0"></td>
                                    <td>
                                        <small>{{(item.prochar_id ? item.prochar_id : item.pro_id) + (item.brand_name ? '/'+item.brand_name : '') + (item.model ? '/'+item.model : '')}}</small><br>
                                        {{item.pro_name}}
                                    </td>
                                    <td align="right">
                                        {{ formatUnit(item.ctn_qty,'PCS')}} <span class="unit">PCS/CTN</span> | {{formatUnit(item.ctn_kgs,'KG')}} <span class="unit">KGS/CTN</span><br>
                                        {{item.ctn_size}} <span class="unit">CM</span> | {{formatUnit(item.ctn_m3,'M3')}} <span class="unit">CBM/CTN</span>
                                    </td>
                                    <td align="right">
                                        {{formatUnit(item.qty,'UN')}} <span class="unit">CTN</span><br />
                                        {{formatUnit(item.qty_sum,'UN')}} <span class="unit">PCS</span>
                                    </td>
                                    <td align="right">
                                        {{formatUnit(item.price,'$')}} <span class="unit">CNY</span><br>
                                        {{formatUnit(item.price_sum,'$')}} <span class="unit">CNY</span>
                                    </td>
                                    <td> {{item.nickname}} <br /><small> {{item.delivery_time}} </small></td>
                                    <td class="text-right">
                                        <div>
                                          <button class='btn btn-sm btn-primary' data-toggle="modal" data-target="#plan_detailModal" @click="changeplan(index)" v-show="data.sign_day==0"><span class="glyphicon glyphicon-modal-window"></span> {:strtoupper(lang('edit'))}</button>
                                          <a href="javascript:;" class='btn btn-sm btn-default' @click="delplan(index,item.id)" v-show="data.sign_day==0"><span class="glyphicon glyphicon-trash"></span> {:strtoupper(lang('delete'))}</a>
                                        </div>
                                    </td>
                                </tr>
                            </tbody>
                            <tfoot>
                                <tr>
                                    <td colspan="2" align="center">{:strtoupper(lang('total'))}</td>
                                    <td colspan="6" align="right">
                                        <b>
                                        {:strtoupper(lang('product'))}： {{formatUnit(plan.length,'UN')}} <span class="unit">UN</span> / 
                                        {:strtoupper(lang('box_quantity'))}： {{formatUnit(data.qty_sum,'UN')}} <span class="unit">CTN</span> / 
                                        {:strtoupper(lang("volume"))}： {{formatUnit(data.m3_sum,'M3')}} <span class="unit">CBM</span> / 
                                        {:strtoupper(lang("weight"))}： {{formatUnit(data.kgs_sum,'KG')}} <span class="unit">KGS</span> /
                                        {:strtoupper(lang('amount'))}： {{formatUnit(data.price_sum,'$')}} <span class="unit">CNY</span>
                                        </b>
                                    </td>
                                </tr>
                            </tfoot>
                        </table>
                    </div>
                    {if condition="$request eq 'edit'"}
                    <div class="col-md-12 tab-pane" id="po_pack_list">
                        <table class="table table-striped table-hover ntTable">
                            <thead>
                                <tr>
                                    <th>No.</th>
                                    <th>&nbsp;</th>
                                    <th>{:strtoupper(lang('product'))}</th>
                                    <th>{:strtoupper(lang("quantity"))}</th>
                                    <th>{:strtoupper(lang("box_measure"))}</th>
                                    <th>{:strtoupper(lang("volume"))}/{:strtoupper(lang("weight"))}</th>
                                    <th>{:strtoupper(lang("container"))}</th>
                                    <th>{:strtoupper(lang('operate'))}</th>
                                </tr>
                            </thead>
                            <tbody>
                                    <tr v-for="(item,index) in packing">
                                        <td>{{item.content !='k' ? formatUnit(item.id,'ID') : ''}}</td>
                                        <td><img :src="item.img_url" width="48px" height="48px" border="0" v-if="item.content !='k'"></td>
                                        <td>
                                            <template v-if="item.content !='k'">
                                                <template v-if="item.pro_name">
                                                    <small>{{(item.prochar_id ? item.prochar_id : item.pro_id) + (item.brand_name ? '/'+item.brand_name : '') + (item.model ? '/'+item.model : '')}}</small><br>
                                                    {{item.pro_name}}
                                                    <br>
                                                </template>
                                                <span :style="{'line-height': item.pro_name ? '': '60px'}">{{item.note}}</span>
                                                
                                            </template>
                                        </td>

                                        <td align="right">{{formatUnit(item.boxnum,'UN')}}<span class="unit">CTN</span><br /> {{formatUnit(item.num * item.boxnum,'UN')}} <span class="unit">PCS</span></td>

                                        <td align="right">
                                             {{formatUnit(item.num,'UN')}}<span class="unit">PCS/CTN</span> | {{formatUnit(item.witch,'KG')}} <span class="unit">KGS/CTN</span><br>
                                             {{item.size}} <span class="unit">CM</span> | {{formatUnit(item.volume,'M3')}}<span class="unit">CBM/CTN</span>
                                        </td>
                                        <td align="right">
                                            {{formatUnit(item.volume*item.boxnum,'M3')}} <span class="unit">CBM</span><br>
                                            {{formatUnit(item.witch * item.boxnum,'KG')}} <span class="unit">KGS</span>
                                        </td>
                                        <td> 
                                            <a href=" ">{{item.container_name}}</a><br>
                                            {{item.container_name !='-' ? item.ready_day+' . '+item.status : '-'}}
                                        </td>
                                        <td class="text-right">
                                            <div>
                                                <button class='btn btn-sm btn-primary' data-toggle="modal" data-target="#pack_editModal" @click="editzxqd(index)">
                                                    <span class="glyphicon glyphicon-pencil"></span> {:strtoupper(lang('edit'))}
                                                </button>
                                                <a href="javascript:;" class='btn btn-sm btn-default'@click="delzxqd(index)"><span class="glyphicon glyphicon-trash" ></span> {:strtoupper(lang('delete'))}</a>
                                            </div>
                                        </td>
                                    </tr>
                            </tbody>
                            <tfoot>
                                <tr>
                                    <td colspan="2" align="center">{:strtoupper(lang('total'))}</td>
                                    <td colspan="6" align="right">
                                        <b>
                                        {:strtoupper(lang('product'))}： {{formatUnit(sumbox.pro_num,'UN')}} <span class="unit">UN</span> / 
                                        {:strtoupper(lang("box_quantity"))}： {{formatUnit(sumbox.boxnum,'UN')}} <span class="unit">CTN</span> / 
                                        {:strtoupper(lang("volume"))}： {{formatUnit(sumbox.volume,'M3')}} <span class="unit">CBM</span> / 
                                        {:strtoupper(lang("weight"))}： {{formatUnit(sumbox.witch,'KG')}} <span class="unit">KGS</span>
                                        </b>
                                    </td>
                                </tr>
                            </tfoot>
                        </table>
                    </div>
                    {/if}
                </div>
            </div>

            <div class="col-md-4">
                <div class="row">
                    <ul class="nav nav-tabs">
                        <li class="active">
                        	<a href="#po_finance" data-toggle="tab">{:strtoupper(lang("payment_plan"))}<span class="required"></span></a>
                        </li>
                        <li>
                        	<a href="#po_cost" data-toggle="tab">{:strtoupper(lang("other_fee"))}</a>
                        </li>
                        <li>
                        	<a href="#po_terms" data-toggle="tab">{:strtoupper(lang("contract_terms"))}<span class="required"></span></a>
                        </li>
                        <li>
                        	<a href="#po_total" data-toggle="tab">{:strtoupper(lang('total'))}</a>
                        </li>
                        {if condition="$request eq 'edit'"}
                        <li>
                            <a href="#po_log" data-toggle="tab">{:strtoupper(lang("operation_record"))}</a>
                        </li>
                        {/if}
                    </ul>
                </div>
            	<div class="row tab-content" style="margin-top: 1em;">
                	<div class="tab-pane in active" id="po_finance">
                    	<div class="row" v-cloak>
                            <div class="col-md-12">
                                <table class="table table-striped table-hover ntTable">
                                    <colgroup>
                                        <col width="100">
                                        <col>
                                    </colgroup>
                                    <tbody>
                                        <tr>
                                            <td colspan="2" class="text-right">
                                            	<div>
                                                	<a :href="'/admin/customer/bankadd?country_id=2&getbank=1'" type="button" class="btn btn-sm btn-primary" data-toggle="modal" data-target="#bank_Modal"> <span class="glyphicon glyphicon-plus"></span> {:strtoupper(lang("add_a_bank_account"))} </a>
                                                </div>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>{:strtoupper(lang('bank_account'))}<span class="required"></span></td>
                                            <td>
                                            	<select class="form-control" v-model="data.bank_id">
                                                    <option value="0">{:strtoupper(lang("please_select_a_bank_account"))}</option>
                                                    <option :value="item.id" v-for="(item,index) in bank">{{item.name + '/' + item.bankname + '/' + item.account_name + '/' +item.account_num}}</option>
                                                </select>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                                <div class="row" style="padding-right:2em">
                                	<div class="md-col-12 text-right">
                                    	<div>
                                            <button type="button" class="btn btn-sm btn-default" @click="payplan(1)"> <span class="fa fa-calculator"></span> {:strtoupper(lang("automatic_generated"))} 30%+70% </button>
                                            <button type="button" class="btn btn-sm btn-default"  @click="payplan(2)"> <span class="fa fa-calculator"></span> {:strtoupper(lang("automatic_generated"))} 100% </button>
                                            <button type="button" class="btn btn-sm btn-primary" @click="openmodel(false)"> <span class="glyphicon glyphicon-plus"></span> {:strtoupper(lang('add'))} {:strtoupper(lang('payment_plan'))} </button>
                                       	</div>
                                    </div>
                                </div>
                                <table class="table table-striped table-hover ntTable" v-show="this.paypoarr.length">
                                	<thead>
                                    	<tr>
                                        	<td>{:strtoupper(lang("payment_date"))}</td>
                                            <td>{:strtoupper(lang('payment_amount'))}</td>
                                            <td>百份比</td>
                                            <td>{:strtoupper(lang('operate'))}</td>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr v-for="(item,index) in this.paypoarr">
                                            <td>{{item.pay_day}}</td> 
                                            <td align="right"> {{formatUnit(item.amount,'$')}} <span class="unit">CNY</span></td>
                                            <td align="right"> {{formatUnit(item.percent,'%')}}<span class="unit">%</span></td>
                                            <td align="right">
                                            	<div>
                                                	<button type="button" class="btn btn-sm btn-primary" @click="openmodel(true,index)"> <span class="glyphicon glyphicon-pencil"></span> {:strtoupper(lang('edit'))} </button>
                                                    <button type="button" class="btn btn-sm btn-default" @click="delpay(index)"> <span class="glyphicon glyphicon-remove"></span> {:strtoupper(lang('delete'))} </button>
                                                </div>
                                            </td>
                                        </tr>
									</tbody>
                                    <tfoot>
                                        <tr>
                                            <td>{:strtoupper(lang("total_payment"))}</td>
                                            <td colspan="2" align="right"><span class="red">{{data.price_sum ? formatUnit(data.price_sum,'$'): '-'}}</span> <span class="unit">CNY</span></td>
                                            <td>&nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td>{:strtoupper(lang("total_pay_for"))}</td>
                                            <td colspan="2" align="right">
                                                <span class="red"> {{data.replace_sum ? formatUnit(data.replace_sum,'$') : '-'}}</span> 
                                                <span class="unit">CNY</span>
                                            </td>
                                            <td>&nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td>{:strtoupper(lang("total_payable"))}</td>
                                            <td colspan="2" align="right"><span class="red">{{formatUnit(data.price_sum+data.replace_sum,'$')}}</span> <span class="unit">CNY</span></td>
                                            <td>&nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td>{:strtoupper(lang("total_paid"))}</td>
                                            <td colspan="2" align="right"><span class="red">{{data.paid_sum ? formatUnit(data.paid_sum,'$') : '-'}}</span> <span class="unit">CNY</span></td>
                                            <td>&nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td>{:strtoupper(lang("total_unpaid"))}</td>
                                            <td colspan="2" align="right"><span class="red">{{formatUnit(data.price_sum+data.replace_sum-data.paid_sum,'$')}}</span> <span class="unit">CNY</span></td>
                                            <td>&nbsp;</td>
                                        </tr>
                                    </tfoot>
                                </table>
                            </div>
                        </div>
                    </div>

                    <div class="tab-pane" id="po_cost">
                        <div class="col-md-12 text-right" style="padding:0.5em">
                            <button type="button" class="btn btn-sm btn-primary" data-toggle="modal" data-target="#cost_Modal"> <span class="glyphicon glyphicon-plus"></span> 添加合同费用 </button>
                        </div>
                        <table class="table table-striped table-hover ntTable">
                            <thead>
                                <tr>
                                    <td>{:strtoupper(lang("other_fee"))}</td>
                                    <td>{:strtoupper(lang('amount'))}</td>
                                    <td>{:strtoupper(lang("apportion"))}</td>
                                    <td>{:strtoupper(lang("pay_for"))}</td>
                                    <td>{:strtoupper(lang('operate'))}</td>
                                </tr>
							</thead>
                            <tbody>
                                <tr v-for="(item,index) in cost_list">
                                    <td>{{item.remarks}}</td>
                                    <td align="right"><span :class="item.amount>0 ? 'green':'red'">{{ formatUnit(item.amount,'CNY') }}</span> <span class="unit">CNY</span></td>
                                    <td align="center">{{item.apportion ? 'O' : '-'}}</td>
                                    <td align="center">{{item.is_replace_pay ? 'O' : '-'}}</td>
                                    <td class="text-right">
                                        <a href="#" type="button" class="btn btn-sm btn-primary" data-toggle="modal" data-target="#cost_Modal" @click="editother(index)">
                                            <span class="glyphicon glyphicon-pencil"></span> {:strtoupper(lang('edit'))}
                                        </a>
	                                    <button type="button" class="btn btn-sm btn-default" @click="delother(index)"> <span class="glyphicon glyphicon-remove"></span> {:strtoupper(lang('delete'))} </button>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>

                	<div class="tab-pane" id="po_terms">

                        <div class="row">
                            <div class="col-md-12 text-right" style="padding:0.5em 1em">
                                <button type="button" class="btn btn-sm btn-primary" data-toggle="modal" data-target="#terms_editModal" @click="clickTermsFun()">
                                    <span class="glyphicon glyphicon-plus"></span> 添加条款 
                                </button>
                            </div>
                        </div>
	                    <div class="row">
							<div class="col-md-12">
                                <ul class="nav nav-tabs">
                                    <li class="active">
                                        <a href="#po_terms_normal" data-toggle="tab">{:strtoupper(lang("general_terms"))}</a>
                                    </li>
                                    <li>
                                        <a href="#po_terms_enter" data-toggle="tab">{:strtoupper(lang("delivery_terms"))}</a>
                                    </li>
                                    <li>
                                        <a href="#po_terms_pay" data-toggle="tab">{:strtoupper(lang("payment_terms"))}</a>
                                    </li>
                                    <li>
                                        <a href="#po_terms_after-sale" data-toggle="tab">{:strtoupper(lang("after_sales_terms"))}</a>
                                    </li>
                                </ul>
                            </div>
                        </div>

	                    <div class="row">
                            <div class="col-md-12 tab-content">
                                <div class="tab-pane in active" id="po_terms_normal">
                                	<div style="padding:0.5em">
                                        <textarea style="width:100%;height:40vh;" v-model="terms.general_terms.content" ></textarea> 
                                    </div>
                                </div>
                                <div class="tab-pane" id="po_terms_enter">
                                	<div style="padding:0.5em">
	                                    <textarea style="width:100%;height:40vh;" v-model="terms.delivery_terms.content" ></textarea> 
                                    </div>
                                </div>
                                <div class="tab-pane" id="po_terms_pay">
                                	<div style="padding:0.5em">
	                                    <textarea style="width:100%;height:40vh;" v-model="terms.payment_terms.content"></textarea> 
                                    </div>
                                </div>
                                <div class="tab-pane" id="po_terms_after-sale">
                                	<div style="padding:0.5em">
	                                    <textarea style="width:100%;height:40vh;" v-model="terms.after_sales_terms.content" ></textarea> 
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

                	<div class="tab-pane" id="po_total">
                        <table class="table table-striped table-hover ntTable">
                            <tbody>
                                <tr>
                                    <td>合计箱数</td>
                                    <td align="right">{{formatUnit(data.qty_sum,'UN')}} <span class="unit">CTN</span></td>
                                </tr>
                                <tr>
                                    <td>合计体积</td>
                                    <td align="right">{{formatUnit(data.m3_sum,'M3')}} <span class="unit">CBM</span></td>
                                </tr>
                                <tr>
                                    <td>{:strtoupper(lang("total_weight"))}</td>
                                    <td align="right">{{formatUnit(data.kgs_sum,'KG')}} <span class="unit">KGS</span></td>
                                </tr>
                                <tr>
                                    <td>{:strtoupper(lang("total_amount"))}</td>
                                    <td align="right">{{formatUnit(data.price_sum,'$')}} <span class="unit">CNY</span></td>
                                </tr>
                            </tbody>
                        </table>
                    </div>

                    <div class="tab-pane" id="po_log">
                        <div class="div-scroll" style="max-height:50vh">
                            <table class="table table-striped table-hover ntTable">
                                <thead>
                                    <tr>
                                        <td>时间</td>
                                        <td>{:strtoupper(lang('operate'))}</td>
                                        <td>{:strtoupper(lang('content'))}</td>
                                    </tr>
                                </thead>
                                <tbody>
                                    <tr v-for="(item_l,index_l) in buy_po_logs">
                                        <td>{{item_l.happen_at}}</td>
                                        <td>{{item_l.admin_name}}</td>
                                        <td>{{item_l.content}}</td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>


<!-- 添加/编辑采购清单内容 -->
<div class="modal fade" id="plan_detailModal" tabindex="-1" role="dialog" aria-labelledby="ntModalLabel" aria-hidden="true"  data-backdrop="static" data-keyboard="false">
        <div class="modal-dialog modal-lg">
            <div class="modal-content"  style="width:1000px">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h4 class="modal-title" id="ntModalLabel">{:strtoupper(lang("edit_purchase_plan"))}</h4>
                </div>
                <div class="modal-body">

                    <div class="row">
                        <div class="col-md-12">
                            <div class="alert alert-dismissable alert-info">
                                <button type="button" class="close">×</button>
                                <p></p>
                            </div>
                        </div>
                    </div>

                    <div class="row">
                        <div class="col-md-4">
                            <div class="text-center">
                            <img :src="planInfo.info_img_url"  width="128px" height="128px" border="0"> 
                            </div>
                            <table class="table table-striped table-hover ntTable" v-cloak>
                                <tbody>
                                    <tr>
                                        <td>{:strtoupper(lang('product'))}</td>
                                        <td>
                                            <small>{{formatUnit(planInfo.prochar_id ? planInfo.prochar_id : planInfo.pro_id,'ID') + (planInfo.brand_name ? '/'+planInfo.brand_name : '') + (planInfo.model ? '/'+planInfo.model : '')}} </small><br>
                                            {{planInfo.pro_name}}
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>{:strtoupper(lang("box_measure"))}</td>
                                        <td>
                                            {{formatUnit(planInfo.ctn_qty,'UN')}} <span class="unit">PCS/CTN</span> | {{formatUnit(planInfo.ctn_kgs,'KG')}} <span class="unit">KGS/CTN</span><br>
                                            {{planInfo.ctn_size}} <span class="unit">CM</span> | {{formatUnit(planInfo.ctn_m3,'M3')}} <span class="unit">CBM/CTN</span>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>{:strtoupper(lang("quantity"))}</td>
                                        <td align="right"><input type="number" class="form-control text-right" id="planInfoQty" :value="planInfo.qty"  @input="changeinfo"></td>
                                    </tr>
                                    <tr>
                                        <td>{:strtoupper(lang('price'))}</td>
                                        <td align="right"><input type="number" class="form-control text-right" id="planInfoPrice" :value="planInfo.price" @input="changeinfo" ></td>
                                    </tr>
                                    <tr>
                                        <td>{:strtoupper(lang("total_quantity"))}</td>
                                        <td align="right">{{formatUnit(planInfo.qty_sum,'UN')}} <span class="unit">CTN</span></td>
                                    </tr>
                                    <tr>
                                        <td>{:strtoupper(lang("total_amount"))}</td>
                                        <td align="right">{{formatUnit(planInfo.price_sum,'$')}} <span class="unit">CNY</span></td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                        <div class="col-md-8">
                            <table class="table table-striped table-hover ntTable" v-cloak>
                                <tbody>
                                    <tr>
                                        <td>采购订单编号</td>
                                        <td>{{formatUnit(planInfo.id,'ID')}}</td>
                                        <td>{:strtoupper(lang("designated_buyer"))}</td>
                                        <td>{{planInfo.nickname}}</td>
                                    </tr>
                                    <tr>
                                        <td>{:strtoupper(lang("delivery_time"))}</td>
                                        <td>{{planInfo.delivery_at}}</td>
                                        <td>{:strtoupper(lang("delivery_address"))}</td>
                                        <td>{{planInfo.address}}</td>
                                    </tr>
                                    <tr>
                                        <td>指定采购公司</td>
                                        <td colspan="3">{{planInfo.company_name}}</td>
                                    </tr>
                                </tbody>
                            </table>
                            <table class="table table-striped table-hover ntTable" v-cloak>
                                <tbody>
                                    <tr v-for="(item,index) in planInfo.prodesc_cat">
                                        <td>
                                            <b>{{item.name}}</b>
                                            <textarea class="form-control" style="width:100%;height:12vh" v-model="planInfo.prodesc_cat[index].content">
                                            </textarea>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal"><span class="glyphicon glyphicon-remove"></span>{:strtoupper(lang('close'))}</button>
                    <button type="button" class="btn btn-primary" @click="editsavefun" id="editsavefun"><span class="glyphicon glyphicon-floppy-disk"></span>{:strtoupper(lang('save'))}</button>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal -->
</div>
    
<!-- 添加/编辑装箱内容 -->
<div class="modal fade" id="pack_editModal" tabindex="-1" role="dialog" aria-labelledby="ntModalLabel" aria-hidden="true"  data-backdrop="static" data-keyboard="false">
    <div class="modal-dialog modal-lg" >
        <div class="modal-content" style="width:1000px">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <p></p>
            </div>
            <div class="modal-body">

                <div class="row">
                    <div class="col-md-12">
                        <div class="alert alert-dismissable alert-info">
                            <button type="button" class="close">×</button>
                            <p></p>
                        </div>
                    </div>
                </div>
                <div class="row" style="padding:0.5em">
                    <div class="col-md-12">
                        <div class="form-group">
                            <label>{:strtoupper(lang("packing_content"))}</label>
                            <select class="form-control" v-model="onwpacking.content" v-cloak @change="changepack" id="onwpackingId">
                                <option value="k">{:strtoupper(lang("add_na_empty_box"))}</option>
                                <option v-for="(item,index) in packing" :value="index" :pro_id="item.pro_id" :prochar_id="item.prochar_id
                                "><small>{{(item.prochar_id ? item.prochar_id : item.pro_id) + (item.brand_name ? '/'+item.brand_name : '') + (item.model ? '/'+item.model : '')}}</small>
                                        {{item.pro_name}}</option>
                            </select>
                        </div>
                    </div>
                    
                    <div class="col-md-3">
                        <div class="form-group">
                            <label>{:strtoupper(lang('box_quantity'))}</label>
                            <input type="number" class="form-control" name="qty" placeholder=""  v-model="onwpacking.boxnum">
                        </div>
                    </div>
                    <div class="col-md-3">
                        <div class="form-group">
                            <label>{:strtoupper(lang("quantity"))}/CTN</label>
                            <input type="number" class="form-control" name="ctn_qty" placeholder="每箱数量"  v-model="onwpacking.num">
                        </div>
                    </div>
                    <div class="col-md-3">
                        <div class="form-group">
                            <label>{:strtoupper(lang('box_measure'))}</label>
                            <input type="text" class="form-control" name="ctn_size" placeholder="长x宽x高" v-model="onwpacking.size">
                        </div>
                    </div>
                    <div class="col-md-3">
                        <div class="form-group">
                            <label>{:strtoupper(lang("weight"))}/CTN</label>
                            <input type="number" class="form-control" name="ctn_kgs" placeholder="{:strtoupper(lang('weight_per_box'))}" v-model="onwpacking.witch">
                        </div>
                    </div>
                    <div class="col-md-3">
                        <div class="form-group">
                            <label>{:strtoupper(lang("volume"))}/CTN</label>
                            <input type="number" class="form-control" name="ctn_m3" placeholder="{:strtoupper(lang('volume'))}" v-model="onwpacking.volume">
                        </div>
                    </div>
                    <div class="col-md-12">
                        <div class="form-group">
                            <label>{:strtoupper(lang('remark'))}</label>
                            <textarea class="form-control" style="height:6em" v-model="onwpacking.note"></textarea>
                        </div>
                    </div>
                    <div class="col-md-12">
                        <label class="checkbox-inline">
                            <input type="checkbox" value="option2" v-model="onwpacking.ischeck"> {:strtoupper(lang("update_box_specifications_to_contract_details"))}
                        </label>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal"><span class="glyphicon glyphicon-remove"></span>{:strtoupper(lang('cancel'))}</button>
                <button type="button" class="btn btn-primary" data-dismiss="modal" style="padding-left:24px;padding-right:24px" @click="saveboxcon"><span class="glyphicon glyphicon-floppy-disk"></span>{:strtoupper(lang('save'))}</button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>

<div class="modal fade" id="bank_Modal" tabindex="-1" role="dialog" aria-labelledby="ntModalLabel" aria-hidden="true"  data-backdrop="static" data-keyboard="false">
    <div class="modal-dialog modal-lg">
        <div class="modal-content"  style="width:1000px">

        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>



<!-- 付款安排 -->
<div class="modal fade" id="pay_Modal" tabindex="-1" role="dialog" aria-labelledby="ntModalLabel" aria-hidden="true"  data-backdrop="static" data-keyboard="false">
    <div class="modal-dialog modal-lg">
        <div class="modal-content" style="width:1000px">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-md-12 payment">
                        <div class="alert alert-dismissable alert-info">
                            <button type="button" class="close">×</button>
                            <p></p>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-12">
                        <table class="table table-striped table-hover ntTable">
                            <tbody>
                                <tr>
                                    <td style="vertical-align:middle">{:strtoupper(lang("payment_date"))}<span class="required"></span></td>
                                    <td colspan="3">
                                    	<div class="row">
                                        	<div class="col-md-12">
                                                <div class="input-group date form_datetime"  data-date-format="yyyy-mm-dd" data-link-field="workdate">
                                                    <input class="form-control" type="text" ref="fkdate" v-model="onwpayplan.pay_day">
                                                    <span class="input-group-addon"><span class="glyphicon glyphicon-calendar" style="margin:0"></span></span>
                                                </div>
                                        	</div>
                                        </div>
                                    </td>
                                </tr>
                                <tr>
                                    <td>{:strtoupper(lang('amount'))}<span class="required"></span></td>
                                    <td><input type="number" class="form-control text-right" @input="changemn" v-model="onwpayplan.amount"></td>
                                    <td>百份比<span class="required"></span></td>
                                    <td><input type="text" class="form-control text-right" @input="cahngehalf(onwpayplan.percent)" v-model="onwpayplan.percent"></td>
                                </tr>
                                <tr>
	                                <td>{:strtoupper(lang("automatic_input"))}</td>
                                    <td colspan="4">
                                    	<button  type="button" class="btn btn-default" @click="cahngehalf(10)">10% </button>
                                        <button  type="button" class="btn btn-default" @click="cahngehalf(20)">20% </button>
                                        <button  type="button" class="btn btn-default" @click="cahngehalf(30)">30% </button>
                                        <button  type="button" class="btn btn-default" @click="cahngehalf(40)">40% </button>
                                        <button  type="button" class="btn btn-default" @click="cahngehalf(50)">50% </button>
                                        <button  type="button" class="btn btn-default" @click="cahngehalf(60)">60% </button>
                                        <button  type="button" class="btn btn-default" @click="cahngehalf(70)">70% </button>
                                        <button  type="button" class="btn btn-default" @click="cahngehalf(80)">80% </button>
                                        <button  type="button" class="btn btn-default" @click="cahngehalf(90)">90% </button>
                                        <button  type="button" class="btn btn-default" @click="cahngehalf(100)">100% </button>
                                        <button  type="button" class="btn btn-default" @click="remafun">{:strtoupper(lang("balance"))} </button>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
                <input type="hidden" id="msg-amount" value="{:strtoupper(lang('please_enter_the_correct_amount_or_percentage'))}">
                <input type="hidden" id="msg-time" value="{:strtoupper(lang('please_select_the_time'))}">
                <input type="hidden" id="msg-monny" value="{:strtoupper(lang('please_enter_the_correct_amount_or_percentage'))}">
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal"><span class="glyphicon glyphicon-remove"></span>{:strtoupper(lang('cancel'))}</button>
                <button type="button" class="btn btn-primary" @click="savepay" style="padding-left:24px;padding-right:24px"><span class="glyphicon glyphicon-floppy-disk"></span>{:strtoupper(lang('save'))}</button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>

<!-- 公司资料显示 -->
<div class="modal fade" id="co_detailModal" tabindex="-1" role="dialog" aria-labelledby="ntModalLabel" aria-hidden="true"  data-backdrop="static" data-keyboard="false">
    <div class="modal-dialog modal-lg">
        <div class="modal-content" style="width:1000px">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="ntModalLabel">{:strtoupper(lang("company_information"))}</h4>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-md-12">
                        <table class="table table-striped table-hover ntTable" v-cloak>
                            <tbody>
                                <tr>
                                    <td>{:strtoupper(lang('serial_number'))}</td>
                                    <td>{{conpanyinfo.id}}</td>
                                </tr>
                                <tr>
                                    <td>{:strtoupper(lang('name'))}</td>
                                    <td>{{conpanyinfo.name}}</td>
                                </tr>
                                <tr>
                                    <td>{:strtoupper(lang('address'))}</td>
                                    <td>{{conpanyinfo.addr}}</td>
                                </tr>
                                <tr>
                                    <td>{:strtoupper(lang('ZIP_CODE'))}</td>
                                    <td>{{conpanyinfo.zipcode}}</td>
                                </tr>
                                <tr>
                                    <td>{:strtoupper(lang('belongs_to_seller'))}</td>
                                    <td>{{conpanyinfo.nickname}}</td>
                                </tr>
                                <tr>
                                    <td>{:strtoupper(lang('edit'))}</td>
                                    <td>{{conpanyinfo.create_name}}{{conpanyinfo.create_time ? ('/' + conpanyinfo.create_time) : ''}}</td>
                                </tr>
                                <tr>
                                    <td>{:strtoupper(lang('status'))}</td>
                                    <td>{{conpanyinfo.status}}</td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal"><span class="glyphicon glyphicon-remove"></span>{:strtoupper(lang('close'))}</button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>

<!-- 联系人弹窗 -->
<div class="modal fade" id="linkman_Modal" tabindex="-1" role="dialog" aria-labelledby="ntModalLabel" aria-hidden="true"  data-backdrop="static" data-keyboard="false">
        <div class="modal-dialog modal-lg">
            <div class="modal-content" style="width:1000px">
            </div><!-- /.modal-content -->
        </div><!-- /.modal -->
</div>


<div class="modal fade" id="plan_addModal" tabindex="-1" role="dialog" aria-labelledby="ntModalLabel" aria-hidden="true"  data-backdrop="static" data-keyboard="false">
    <div class="modal-dialog modal-lg" style="width:80%">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="ntModalLabel">{:strtoupper(lang("purchase_plan_added"))}</h4>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-md-12 payment">
                        <div class="alert alert-dismissable alert-info">
                            <button type="button" class="close">×</button>
                            <p></p>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-2">{:strtoupper(lang('purchase_plan_list'))}</div>
                    <div class="col-md-10">
                        <div class="input-group">
                            <input type="text" class="form-control col-md-12" placeholder="{:strtoupper(lang("enter_purchase_plan_ID,_product_name,_role_ID_or_model"))}" width="100%" v-model="searchText">
                            <div class="input-group-btn">
                                <button type="button" class="btn btn-default" @click="getplan(false)">
                                    <span class="glyphicon glyphicon-search"></span> {:strtoupper(lang('search'))}
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-5 text-right" v-cloak>
                        <ul class="nav nav-tabs">
                            <li :class="{'active':index==0}" v-for="(item,index) in montharr"><a href="#" data-toggle="tab" @click="getplan(item)">{{index==0 ? '本月' : item.month+'月'}}</a></li>
                        </ul>            	
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-12">
                        <table class="table table-striped table-hover ntTable" v-cloak>
                            <thead>
                                <tr>
                                    <th class="sorting"> No. </th>
                                    <th>&nbsp;  </th>
                                    <th class="sorting"> {:strtoupper(lang('product'))} </th>
                                    <th> {:strtoupper(lang("quantity"))} </th>
                                    <th> {:strtoupper(lang("box_measure"))} </th>
                                    <th> {:strtoupper(lang("price"))} </th>
                                    <th> {:strtoupper(lang('total'))} </th>
                                    <th class="sorting"> {:strtoupper(lang("purchase"))} </th>
                                    <th class="sorting"> {:strtoupper(lang('delivery_time'))} </th>
                                    <th> {:strtoupper(lang('operate'))} </th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr v-for="(item,index) in Willbe">
                                    <td style="vertical-align:middle">{{formatUnit(item.id,'ID')}}</td>
                                    <td style="vertical-align:middle"><img :src="item.img_url" border="0"></td>
                                    <td> <small>{{formatUnit(item.prochar_id,'ID') + (item.brand_name ? '/'+item.brand_name : '') + (item.model ? '/'+item.model : '')}}</small> <br />{{item.pro_name}} </td>
                                    <td>
                                        <input type="number" class="form-control text-right" v-model="Willbe[index].qty" style="width:6em" @input="
                                        item.qty_sum=item.ctn_qty*item.qty 
                                        item.price_sum=item.ctn_qty*item.qty*item.price">
                                    </td>
                                    <td align="right">
                                        {{item.ctn_qty}} <span class="unit">PCS/CTN</span><br>
                                        {{formatUnit(item.ctn_kgs,'KG')}} <span class="unit">KGS/CTN</span>
                                    </td>
                                    <td align="right">
	                                    <input type="number" class="form-control text-right" v-model="Willbe[index].price" style="width:6em" @input="
                                        item.price_sum=item.ctn_qty*item.qty*item.price">
                                    </td>
                                    <td align="right">
                                        {{formatUnit(item.qty_sum,'UN')}}  <span class="unit">PCS</span><br>
                                        {{formatUnit(item.price_sum,'$')}}  <span class="unit">CNY</span>
                                    </td>
                                    <td> {{item.nickname}} <br> <small> {{item.company_name}} </small> </td>
                                    <td> {{item.delivery_time}} <br /> <small>{{item.address}}</small> </td>
                                    <td style="vertical-align:middle" class="text-right">
                                    	<a href="javascript:;" class='btn btn-sm btn-default' @click="addplan(index)"><span class="glyphicon glyphicon-plus"></span> {:strtoupper(lang("add_in"))}</a>
                                    </td>
                                </tr>
                                <tr><td colspan="10" style="text-align: center;" v-if="Willbe.length==0" class="no_date">{:strtoupper(lang('no_data'))}</td></tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal"><span class="glyphicon glyphicon-remove"></span>{:strtoupper(lang('close'))}</button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>

<div class="modal fade" id="cost_Modal" tabindex="-1" role="dialog" aria-labelledby="ntModalLabel" aria-hidden="true"  data-backdrop="static" data-keyboard="false">
    <div class="modal-dialog modal-lg">
        <div class="modal-content" style="width:1000px">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="ntModalLabel">{:strtoupper(lang("add_other_purchase_ontract_expenses"))}</h4>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-md-12">
                        <div class="alert alert-dismissable alert-info">
                            <button type="button" class="close">×</button>
                            <p></p>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-12">
                        <table class="table table-striped table-hover ntTable" v-cloak>
                            <tbody>
                                <tr>
                                    <td>{:strtoupper(lang("expenditure_or_income_content"))}<span class="required"></span></td>
                                    <td>
                                        <div class="input-group" style="width:100%">
                                            <div class="input-group-btn">
                                                <select  class="form-control" name="" id="" style="width: 200px;" @change="addother.remarks=addother.selcontent" v-model="addother.selcontent">
                                                    <option value="0" selected>{:strtoupper(lang("common_options"))}</option>
                                                    <option :value="item" v-for="(item,index) in commonly" >{{item}}</option>
                                                </select>
                                            </div>
                                            <input type="text" class="form-control col-md-12" width="100%" v-model="addother.remarks">
                                        </div>
                                    </td>
                                </tr>
                                <tr>
	                                <td>&nbsp;</td>
                                    <td>
                                        <label class="radio-inline">
                                            <input type="radio" name="optionsCheckboxsinline" value="1" v-model="addother.In_and_out"> {:strtoupper(lang('income'))}（抵扣货款）
                                        </label>
                                        <label class="radio-inline">
                                            <input type="radio" name="optionsCheckboxsinline" value="0" v-model="addother.In_and_out"> {:strtoupper(lang('expenditure'))}（应付给供应商）
                                        </label>
                                    </td>
                                </tr>
                                <tr>
                                    <td>{:strtoupper(lang('amount'))}<span class="required"></span></td>
                                    <td colspan="3">
                                        <div class="input-group" style="width:100%">
                                            <input type="number" class="form-control text-right" v-model="addother.amount" >
                                            <span class="input-group-addon">
                                                <input type="checkbox" v-model="addother.apportion"> {:strtoupper(lang("allocated_to_cost"))}
                                            </span>
                                        </div>
                                    </td>
                                </tr>
                                <tr>
	                                <td>&nbsp;</td>
                                    <td>
                                        <label class="checkbox-inline">
                                            <input type="checkbox" name="optionsCheckboxsinline" v-model="addother.is_replace_pay"> {:strtoupper(lang("this_amount_is_paid_by_the_supplier"))}
                                        </label>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal"><span class="glyphicon glyphicon-remove"></span>{:strtoupper(lang('cancel'))}</button>
                <button type="button" class="btn btn-primary" @click="saveother" style="padding-left:24px;padding-right:24px"><span class="glyphicon glyphicon-floppy-disk"></span>{:strtoupper(lang('save'))}</button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>


<div class="modal fade" id="terms_editModal" tabindex="-1" role="dialog" aria-labelledby="ntModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg" style="width:60%">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="ntModalLabel">采购合同条款添加/更改</h4>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-md-12">
                        <div class="alert alert-dismissable alert-info">
                            <button type="button" class="close">×</button>
                            <p></p>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-12">
                        <ul class="nav nav-tabs">
                            <li class="active" @click="clickTermsFun('get','general_terms')">
                                <a href="#terms_content" data-toggle="tab">+常规条款</a>
                            </li>
                            <li  @click="clickTermsFun('get','delivery_terms')">
                                <a href="#terms_content" data-toggle="tab">+送货条款</a>
                            </li>
                            <li @click="clickTermsFun('get','payment_terms')">
                                <a href="#terms_content" data-toggle="tab">+付款条款</a>
                            </li>
                            <li @click="clickTermsFun('get','after_sales_terms')">
                                <a href="#terms_content" data-toggle="tab">+售后条款</a>
                            </li>
                        </ul>
                    </div>
                </div>
                <div class="row clearfix">
                    <div class="col-md-12 tab-content">
                        <div class="tab-pane in active" id="terms_content">
                            <table class="table table-striped table-hover ntTable">
                                <thead>
                                    <tr>
                                        <th class="sorting"> 内容 </th>
                                        <th class="sorting">必需</th>
                                        <th class="sorting" width="10%"> 排序 </th>
                                        <th width="10%"> 操作 </th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <template v-if="clickTerms.length > 0">
                                        <tr v-for="(clickTermsItem,clickTermsIndex) in clickTerms">
                                            <td>{{clickTermsItem.content}}</td>
                                            <td align="right"> {{clickTermsItem.is_must ? "O" : '-'}} </td>
                                            <td align="right"> {{clickTermsItem.drank}} </td>
                                            <td class="text-right">
                                                <div @click="clickTermsFun('add',clickTermsItem.type,clickTermsIndex)">
                                                    <a href="#" class='btn btn-sm btn-default option-del'><span class="glyphicon glyphicon-plus"></span>添加</a>
                                                </div>
                                            </td>
                                        </tr>
                                    </template>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal"><span class="glyphicon glyphicon-remove"></span>关闭</button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>

</div>
<script>$('.loding').hide()</script>
<script src="/static/Admin/js/plan2po.js"></script>
{include file="public/foot"/}